SUBROUTINE ZMUSIC_COMMON(R, N, M, G)
  IMPLICIT NONE
  INTEGER :: N, M, I, K, LWORK, INFO
  COMPLEX*16 ,ALLOCATABLE :: WORK(:)
  COMPLEX*16 :: R(M,M), G(M, M-N)
  DOUBLE PRECISION :: W(M), RWORK(3*M-2)

  ALLOCATE( WORK(1) )
  LWORK = -1
  CALL ZHEEV('V', 'L', M, R, M, W, WORK, LWORK, RWORK, INFO)
  LWORK = INT(WORK(1))
  DEALLOCATE (WORK)
  ALLOCATE( WORK(LWORK) )
  CALL ZHEEV('V', 'L', M, R, M, W, WORK, LWORK, RWORK, INFO)
  G = R(:, 1:M-N)
  DEALLOCATE (WORK)

END SUBROUTINE ZMUSIC_COMMON
